﻿using System;
using System.Collections.Generic;

public class NumberSquare : Square
{
    // Holds a number (the number of adjacent mines)
    public int NumberValue { get; set; }

    //holds the colors for the different numbers. There are 8 possible numbers. 
    //Color to each number is  numberColors[number - 1]
    private static readonly List<ConsoleColor> numberColors = new List<ConsoleColor>()
    {
        ConsoleColor.Cyan,
        ConsoleColor.Green,
        ConsoleColor.Magenta,
        ConsoleColor.DarkCyan,
        ConsoleColor.Yellow,
        ConsoleColor.Yellow,
        ConsoleColor.Red,
        ConsoleColor.Red,
    };

    public NumberSquare(int numberValue)
    {
        this.NumberValue = numberValue;
        this.IsOpened = false;
        int asciiCode = 48;
        this.Image = new char[,] { { (char)(numberValue + asciiCode) } };
        this.Color = numberColors[numberValue - 1];
    }
}
